//
//  AppDelegate.m
//  weibo
//
//  Created by 王俊 on 15/12/19.
//  Copyright © 2015年 王俊. All rights reserved.
//

#import "AppDelegate.h"
#import "WJTabBarController.h"
#import "WJNewfeatureController.h"
#import "WJOAuthController.h"
#import "WJWelcomeController.h"

@interface AppDelegate ()
@property(nonatomic,strong) UIViewController  *vc;

@end

@implementation AppDelegate


- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    self.window = [[UIWindow alloc]initWithFrame:[UIScreen mainScreen].bounds];
    NSString *key = @"CFBundleVersion";
    NSString *currentVersion = [[NSBundle mainBundle].infoDictionary objectForKey:key];
    //WJLog(@"%@",currentVersion);
    
    NSString *lastVersion = [[NSUserDefaults standardUserDefaults] objectForKey:key];
    if ([lastVersion isEqualToString:currentVersion]) {
        _vc = [[WJWelcomeController alloc]init];
    }else{
        _vc = [[WJNewfeatureController alloc]init];
        [[NSUserDefaults standardUserDefaults] setObject:currentVersion forKey:key];
    }

    
    self.window.rootViewController = _vc;
//    self.window.rootViewController = [[WJOAuthController alloc]init];
    [self.window makeKeyAndVisible];
    return YES;
}

- (void)applicationWillResignActive:(UIApplication *)application
{
}

- (void)applicationDidEnterBackground:(UIApplication *)application
{
}

- (void)applicationWillEnterForeground:(UIApplication *)application
{
}

- (void)applicationDidBecomeActive:(UIApplication *)application
{
}

- (void)applicationWillTerminate:(UIApplication *)application
{
}

@end
